package org.liukai.ems.service;

import javax.annotation.Resource;

import org.liukai.ems.dao.UserDao;
import org.liukai.ems.entity.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserService {
	//注入  该注解和@Resource一样
    @Autowired
    private UserDao userDao;

    public User queryUserByUserName(String username) {
        return userDao.queryUserByUserName(username);
    }

    public List<User> queryAllUser() {
        List<User> list = userDao.queryAllUser();
        return list;
    }




    public User queryUserByUserId(String userId){
        return userDao.queryUserByUserId(userId);
    }

    public void addUser(User user) {
        userDao.addUser(user);
    }

    public void deleteUser(String userId){
        userDao.deleteUser(userId);
    }

    public void updateUser(User user) {
        userDao.updateUser(user);
    }


}
